<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="row">
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-project_id" class="control-label col-xs-12 col-sm-2">{:__('项目')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-project_id"  data-source="workteam/project/index" data-field="name"
                       class="form-control selectpage" name="row[project_id]" type="text" value="{$row.project_id}" disabled>

            </div>
        </div>
        {if $row.pid}
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-pid" class="control-label col-xs-12 col-sm-2">{:__('父任务')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-pid"  data-source="workteam/task/index" data-field="name"
                       class="form-control selectpage" name="row[pid]" type="text" value="{$row.pid}" disabled>
                <span class="text-red">*不能修改</span>
            </div>
        </div>


        {/if}



        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('任务名称')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-name" data-rule="required" type="text" class="form-control" name="row[name]" value="{$row.name}"/>
            </div>
        </div>



        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-start_time" class="control-label col-xs-12 col-sm-2">{:__('开始时间')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-start_time" value="{:datetime($row.start_time)}" class="form-control datetimepicker"
                       data-date-format="YYYY-MM-DD HH:mm" data-use-current="true" name="row[start_time]" type="text">
            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-end_time" class="control-label col-xs-12 col-sm-2">{:__('截止时间')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-end_time" value="{:datetime($row.end_time)}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm"
                       data-use-current="true" name="row[end_time]" type="text">
                <span class="text-red text-end_time"></span>
            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-plan_hours" class="control-label col-xs-12 col-sm-2">{:__('安排工时')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-plan_hours" type="number" class="form-control" name="row[plan_hours]" value="{$row.plan_hours}"/>
                <!--<span class="text-red ">{:__('工时不能修改')}</span>-->
            </div>

        </div>

        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-group_id" class="control-label col-xs-12 col-sm-2">{:__('归属部门')}:</label>
            <div class="col-xs-12 col-sm-8">
                {:build_select('row[group_id]', $groupdata, $row['group_id'], ['class'=>'form-control selectpicker', 'id'=>'c-group_id'])}
                <span class="help-block"></span>
            </div>
        </div>

        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-admin_id" class="control-label col-xs-12 col-sm-2">{:__('负责人')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-admin_id" data-rule="required"  data-source="workteam/common/selectpage/model/admin/type/all" data-field="nickname"
                       class="form-control selectpage" name="row[admin_id]" type="text" value="{$row.admin_id}">

            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-admin_ids" class="control-label col-xs-12 col-sm-2">{:__('参与人')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-admin_ids"  data-source="workteam/common/selectpage/model/admin/type/all" data-multiple="true" data-field="nickname"
                       class="form-control selectpage" name="row[admin_ids]" type="text" value="{$row.admin_ids}">
                <span class="help-block">*只有查看权限，获得不了工时</span>
            </div>
        </div>
        <div class="form-group col-md-4 col-xs-12">
            <label class="control-label col-xs-12 col-sm-2">{:__('优先级')}:</label>
            <div class="col-xs-12 col-sm-8">
                <select id="c-level" class="form-control selectpicker" name="row[level]">
                    {foreach name="levelList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.level" }selected{/in}>{$vo}</option>
                    {/foreach}
                </select>
                <span class="text-red "></span>
            </div>
        </div>

        <div class="form-group col-md-4 col-xs-12">
            <label class="control-label col-xs-12 col-sm-2">{:__('任务状态')}:</label>
            <div class="col-xs-12 col-sm-8">
                <select id="c-status" class="form-control selectpicker" name="row[status]" {if $row.status==2}disabled{/if}>
                    {foreach name="statusList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.status" }selected{/in}>{$vo}</option>
                    {/foreach}
                </select>
                <span class="text-red ">{:__('* 完成的任务不能更改')}</span>
            </div>
        </div>

        <div class="form-group col-md-4 col-xs-12 complete_time"  {if $row.status !="2" }style="display: none"{/if}>
			<label class="control-label col-xs-12 col-sm-2">{:__('完成时间')}:</label>
			<div class="col-xs-12 col-sm-8">
				<input id="c-complete_time" value="{$row.complete_time?datetime($row.complete_time):time()}"  class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm"
					   data-use-current="true" name="row[complete_time]" type="text">
				<span class="text-red "></span>
			</div>
		</div>
        <div class="form-group col-md-4 col-xs-12 service_hours"  {if $row.status !="2" }style="display: none"{/if}>
			<label class="control-label col-xs-12 col-sm-2">{:__('服务时长(分钟)')}:</label>
			<div class="col-xs-12 col-sm-8">
				<input id="c-service_hours" value="{$row.service_hours}"  class="form-control" name="row[service_hours]" type="text">
			</div>
		</div>
        <div class="form-group col-md-4 col-xs-12 complete_time" style="display: none">
			<label class="control-label col-xs-12 col-sm-2">{:__('服务对象')}:</label>
			<div class="col-xs-12 col-sm-8">
				<input id="c-service_client" data-source='{:config_to_source($service_client)}' data-field="value" data-primary-key="key" data-order-by="key" data-multiple="true" class="form-control selectpage" name="row[service_client]" type="text" value=""   >
			</div>
		</div>
        <div class="form-group col-md-4 col-xs-12 complete_time" style="display: none">
			<label class="control-label col-xs-12 col-sm-2">{:__('隐私内容')}:<span class="text-red ">隐私内容，不宜对外展示</span></label>
			<div class="col-xs-12 col-sm-8">
                <textarea id="c-secret" class="form-control editor" name="row[secret]"></textarea>
            </div>
		</div>

        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('任务内容')}:</label>
            <div class="col-xs-12 col-sm-8">
                <textarea id="c-content" class="form-control editor" name="row[content]">{$row.content}</textarea>

            </div>
        </div>

    </div>


    <div class="row">

        <div class="panel panel-default panel-intro col-xs-12 col-md-12">
            <div class="panel-heading">
                <div class="panel-lead"><em>{:__('附件')}</em></div>

            </div>
            <div class="panel-body">
                <div id="toolbar" class="toolbar">
                    {:build_toolbar('refresh')}
                    <input type="hidden" id="c-third" value="">
                    <button type="button" id="faupload-third" class="btn btn-danger faupload {:$auth->check('workteam/task/filesadd')?'':'hide'}" data-multiple="true" data-input-id="c-third" >
                        <i class="fa fa-upload"></i> {:__('上传')}</button>


                </div>
                <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                       data-operate-filesdel="{:$auth->check('workteam/task/filesdel')}"
                       width="100%">
                </table>

            </div>
        </div>




    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>


<script>
    var task_id={$row.id};

</script>


